<template>
<view>
<view>
	<view class="dizhi" v-for="(item,index) in address" :key="index">
		<view class="shangs">
			<view class="name"> {{item.name}}</view>
			<view class="number">{{item.phone}}</view>
		</view>
		<view class="zhongs">
			<view class="didi objectId">{{item.region}}{{item.addr}}</view>
		</view>
		<view class="xias">
			<view class="xiaswarp">
				<view class="ddizhi">
					<checkbox class="fuxuan didizhi"> 设置为地址</checkbox>
				</view>
				<view class="bbian" @tap="gotoedit()">
					<i class="iconfont bian">&#xe60f;</i>
					<view class="bianji">编辑</view>
				</view>
				<view class="sshan" @tap="godelete()">
					<i class="iconfont shan">&#xe623;</i>
					<view class="shanchu">删除</view>
				</view>
				
			</view>
		</view>
	</view>
</view>	
<view class="tabbares">
		<view class="tianjia">
			<button class="shoudong" @tap="shoudongtianjia()">手动添加</button>
		<!-- 	<button class="weixin">微信添加</button> -->
		</view>
	</view>
</view>



</template>

<script>
	export default {
		data() {
			return {
			   address:[],
			}
		},
		onLoad() {
	
		},
		mounted() {
			
			//根据用户id获取地址
			uni.request({
				url: 'https://www.zunyishengshui.com/maishui/address/selectAddressByUserId', 
				method:'POST',
				data: {
					userId: '12321312312313'
				},
				header:{
					'content-type': 'application/x-www-form-urlencoded', 
				},
				success: (res) => {
					console.log(res);
					this.address = res.data.data;
					this.text = 'request success';
				}
			})			
			
			
			
			
		},
		methods: {
	        shoudongtianjia(){
				uni.navigateTo({
					url:"../newpeople/newpeople"
				})
			},
			//删除
			godelete(){
				uni.navigateTo({
					url:""
				})
			},
			//编辑
			gotoedit(){
				uni.navigateTo({
					url:"../newpeople/newpeople"
				})
			}
			
		}
	}
</script>

<style>
.dizhi{
	width: 100%;
	height: 121px;
	display: flex;
	flex-direction: column;
}
.shangs{
	width: 100%;
	height: 78upx;
}
.zhongs{
	width: 100%;
	height: 78upx;
	border-bottom: 1px solid #EEEEEE;
}	
.xias{
	width: 100%;
	height: 120upx;
}	
.name{
	float: left;
	font-size: 14px;
	margin-top: 24upx;
	margin-left: 38upx;
}	
.number{
	float: right;
	font-size: 14px;
	color: #999999;
	margin-top: 24upx;
	margin-right: 30upx;
}	
.didi{
	font-size: 24upx;
	color: #101010;
	margin-left: 38upx;
	line-height: 78upx;
}	
.didizhi{
	font-size: 12px;
	position: absolute;
	top: 46upx;
	left: 94upx;
}	
.xiaswarp{
	position: relative;
}
.fuxuan{
	position: absolute;
	left:42upx;
	top: 44upx;
}	
.bian{
	position: absolute;
	right: 198upx;
	top: 44upx;
}	
.bianji{
	position: absolute;
	right:144upx;
	top: 46upx;
	font-size: 12px;
}	
.shan{
	position: absolute;
	top: 44upx;
	right: 80upx;
}	
.shanchu{
	font-size: 12px;
	position: absolute;
	top: 44upx;
	right: 24upx;
}	
.tabbares{
	width: 100%;
	height: 80upx;
}
.tianjia{
	display: flex;
	width: 100%;
	height: 80upx;
}	
.shoudong{
	width: 60%;
	height: 80upx;
	background: #3B9CDB;
	color: #FFFFFF;
}	
.weixin{
	width: 286upx;
	height: 80upx;
	background: #259B24;
	color: #FFFFFF;
}	
	
	
	
	
	
	
	
</style>
